<?php 
/*
 *  NAV 导航
 * 
 */

class Model_Core_Nav{
	
	public function nav($kind, $url, $id, $class="-1", $sub="-1"){
		$menuname = new Model_Dbtable_Wowmenu();
		$menuname = $menuname->menuname($url);
		
		$classname = new Model_Dbtable_Wowmenuclass();
		$classname = $classname->classname($class);
		
		$subname = new Model_Dbtable_Wowmenusub();
		$subname = $subname->subname($class, $sub);
		
		if ($url){
			$nav = "<li><span class=\"right\">></span><a href=\"/$kind/$url\">$menuname[name]</a></li>";
		}
		if ($class != "-1"){
			$nav .= "<li><span class=\"right\">></span><a href=\"/$kind/$url?class=$class\">$classname[class_name]</a></li>";
		}
    	if ($sub != "-1"){
			$nav .= "<li><span class=\"right\">></span><a href=\"/$kind/$url?class=$class&sub=$sub\">$subname[sub_name]</a></li>";
		}
		
		if ($id){
			$nav .= "<li><span class=\"right\">></span><a href=\"javascript:;\">$id</a></li>";
		}
		return $nav;
	}
	
}